<template>
  <div class="storey-title">
    <div class="storey-left-icon">
      <slot name="svg"></slot>
      <span>{{title}}</span>
      <slot name='time'></slot>
    </div>
    <div class="storey-right-btnbox" v-if="isShow">
      <div class="storey-btn storey-btn-left">
        <i class="el-icon-refresh iconRefresh"></i>
        换一换
      </div>
      <div class="storey-btn storey-btn-more">
        更多
        <i class="el-icon-arrow-right"></i>
      </div>
    </div>
    <slot name='rightinfo'></slot>
  </div>
</template>

<script>
  export default {
    name: 'StoreyTitle',
    props:{
      title:String,
      isShow:{
        type:Boolean,
        required:false,
        default:true
      }
    }
  }
</script>

<style scoped>
  .storey-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    height: 36px;
  }
  .storey-left-icon{
    display: inline-flex;
  }
  .storey-left-icon>span{
    margin: 0 20px 0 0;
    vertical-align: bottom;
    font-size: 20px;
    line-height: 36px;
    color:#212121;
    cursor: pointer;
    transition: color .3s;
  }
  .storey-left-icon>span:hover{
    color:#00A1D6;
  }
  .storey-right-btnbox{
    display: flex;
  }
  .storey-btn{
    display: flex;
    align-items: center;
    cursor: pointer;
    height: 22px;
    text-align: center;
    border: 1px solid silver;
    box-sizing: border-box;
    border-radius: 2px;
    color:#505050;
    font-size:12px;
    transition: all .2s;
    line-height: 16px;
  }
  .storey-btn-left{
    padding:0 0 0 6px;
    width: 72px;
  }
  .iconRefresh{
    margin-right: 4px;
    vertical-align: middle;
    font-size: 16px;
    transform:rotate(360deg);
    transition: all .5s;
  }
  .storey-btn-more{
    padding:0 0 0 12px;
    width: 58px;
    margin-left:12px;
  }
 /* .storey-btn-more>i{
    font-size: 14px;
    vertical-align: middle;
  } */
  .storey-btn:hover{
    background: #f4f4f4;
  }
  .storey-btn-left:hover .iconRefresh{
    transform:rotate(0deg);
  }
  svg{
    width: 36px;
    height:36px;
    margin-right: 6px;
    vertical-align: middle;
    fill: currentColor;
  }
</style>
